package com.wyd.observer.demo01;

/**
 * @author Yudi Wang
 * @date 2022/1/6 11:06
 */
public class PressureDisplay {
    private int pressure;

    /**
     * 当监测值发生变化时，做出相应的反应
     * @param temperature
     * @param pressure
     */
    public void update(int temperature, int pressure){
        this.pressure = pressure;
        display();
    }

    private void display(){
        System.out.println("当前气压为：" + pressure);
    }

}
